import request from "@/utils/request";

export function listData(query) {
  return request({
    url: `/user-manager/backpack-gift${query}`,
    method: "get"
  });
}

export function listTypeData(query) {
  return request({
    url: `/gift/list`,
    method: "post",
    data: query
  });
}

export function deleteData(ids) {
  return request({
    url: `/user-manager/backpack-gift`,
    method: "delete",
    data: {ids}
  });
}

export function postFreeze(id, form) {
  return request({
    url: `/user-manager/backpack-gift/freeze/${id}`,
    method: "post",
    data: form
  });
}

export function postFreezeAll(ids) {
  return request({
    url: `/user-manager/backpack-gift/vast-freeze`,
    method: "post",
    data: { ids }
  });
}

export function getExport(params) {
  return request({
    url: "/user-manager/backpack-gift/excel",
    method: "get",
    params
  });
}

export function getExportAsync(params) {
  return request({
    url: "/user-manager/backpack-gift/excel/async",
    method: "get",
    params
  });
}
